package com.SPOooON.googletaskssync;

import java.io.IOException;
import java.util.List;

import com.google.api.client.extensions.android2.AndroidHttp;
import com.google.api.client.googleapis.auth.oauth2.draft10.GoogleAccessProtectedResource;
import com.google.api.client.googleapis.extensions.android2.auth.GoogleAccountManager;
import com.google.api.client.http.HttpResponse;
import com.google.api.client.http.HttpResponseException;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.http.json.JsonHttpRequest;
import com.google.api.client.http.json.JsonHttpRequestInitializer;
import com.google.api.client.json.jackson.JacksonFactory;
import com.google.api.services.tasks.Tasks;
import com.google.api.services.tasks.TasksRequest;
import com.google.api.services.tasks.model.Task;
import com.google.api.services.tasks.model.TaskList;

import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.AccountManagerCallback;
import android.accounts.AccountManagerFuture;
import android.accounts.AuthenticatorException;
import android.accounts.OperationCanceledException;
import android.app.Service;
import android.content.AbstractThreadedSyncAdapter;
import android.content.ContentProviderClient;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.SyncResult;
import android.os.Bundle;
import android.os.IBinder;
import android.util.Log;

public class GoogleTasksSyncAdapterService extends Service {

	private static final String TAG = "GoogleTasksSyncAdapterService";
	private GoogleTasksSyncAdapter syncAdapter;
	
	@Override
	public IBinder onBind(Intent intent) {
		return this.getGoogleTasksSyncAdapter().getSyncAdapterBinder();
	}
	
	private GoogleTasksSyncAdapter getGoogleTasksSyncAdapter() {
		if (syncAdapter == null)
			syncAdapter = new GoogleTasksSyncAdapter(this);
		
		return syncAdapter;
	}
}